package com.atlin.project.model.vo;

import com.atlin.project.model.domain.task.TaskSpaces;
import lombok.Data;
import org.springframework.beans.BeanUtils;

import java.io.Serializable;
import java.util.Date;

/**
 * 示例表
 *
 * @TableName taskSpaces
 */
@Data
public class TaskSpacesVO implements Serializable {

    
    /**
     * 空间ID
     */
    
    private Long id;

    /**
     * 空间名称（如"个人"、"公司A"）
     */
    private String name;

    /**
     * 空间描述
     */
    private String description;

    /**
     * 空间类型 personal, team, company
     */
    private String spaceType;

    /**
     * 创建时间
     */
    private Date createdAt;

    /**
     * 创建者用户ID
     */
    private Integer creatorId;

    /**
     * 包装类转对象
     *
     * @param taskSpacesVO
     * @return
     */
    public static TaskSpaces voToObj(TaskSpacesVO taskSpacesVO) {
        if (taskSpacesVO == null) {
            return null;
        }
        TaskSpaces taskSpaces = new TaskSpaces();
        BeanUtils.copyProperties(taskSpacesVO, taskSpaces);
        return taskSpaces;
    }


    /**
     * 对象转包装类
     *
     * @param taskSpaces
     * @return
     */
    public static TaskSpacesVO objToVo(TaskSpaces taskSpaces) {
        if (taskSpaces == null) {
            return null;
        }
        TaskSpacesVO taskSpacesVO = new TaskSpacesVO();
        BeanUtils.copyProperties(taskSpaces, taskSpacesVO);

        return taskSpacesVO;
    }

    private static final long serialVersionUID = 1L;
}